]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: fix two warnings when removing a network device
authorDan Winship <danw@gnome.org>
Mon, 4 Apr 2011 12:31:55 +0000 (08:31 -0400)
committerDan Winship <danw@gnome.org>
Mon, 11 Apr 2011 14:38:00 +0000 (10:38 -0400)
NMApplet connects to each NMDevice's state-changed signal and stores
the signal handler id on the NMDevice itself. However, it was using
the same name as NMDevice itself was using to store the handler ID for
the underlying GObject's state-changed signal, thus overwriting it,
and resulting in *neither* signal handler getting removed if the
device went away. (This probably isn't a problem, since the device is
going away, but it causes a warning.)

Also, at least for WWAN devices, the device state changes to UNMANAGED
immediately before disappearing, but getStatusLabel() wasn't handling
that case and printed a warning instead. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=646708

js/ui/status/network.js

index 5510272c1549b796c319524e6a9f3f095a6190f8..90affc3ebd80e7727ac8755b231c4aae4f47ab03 100644 (file)
@@ -492,6 +492,7 @@ NMDevice.prototype = {
 
     getStatusLabel: function() {
         switch(this.device.state) {
+        case NetworkManager.DeviceState.UNMANAGED:
         case NetworkManager.DeviceState.DISCONNECTED:
         case NetworkManager.DeviceState.ACTIVATED:
             return null;
@@ -1711,13 +1712,13 @@ NMApplet.prototype = {
                                                                 { icon: icon });
                 this._source.notify(notification);
             })); */
-            wrapper._stateChangedId = wrapper.connect('state-changed', Lang.bind(this, function(dev) {
+            wrapper._deviceStateChangedId = wrapper.connect('state-changed', Lang.bind(this, function(dev) {
                 this._syncSectionTitle(dev.category);
             }));
             wrapper._destroyId = wrapper.connect('destroy', function(wrapper) {
                 //wrapper.disconnect(wrapper._networkLostId);
                 //wrapper.disconnect(wrapper._activationFailedId);
-                wrapper.disconnect(wrapper._stateChangedId);
+                wrapper.disconnect(wrapper._deviceStateChangedId);
             });
             let section = this._devices[wrapper.category].section;
             let devices = this._devices[wrapper.category].devices;